
/**
 * Checks if an object has a specific key.
 *
 * @param {Object} obj - The object to check.
 * @param {string} key - The key to check for.
 * @returns {boolean} - Returns true if the object has the key, otherwise false.
 */
export function hasKey(obj, key) {
  return key in obj;
}

/**
 * Checks if a string or a number contains a specific character.
 *
 * @param {string|number} value - The string or number to check.
 * @param {string} char - The character to check for.
 * @returns {boolean} - Returns true if the value contains the character, otherwise false.
 */
export function containsCharacter(value, char) {
  const stringValue = String(value);
  return stringValue.includes(char);
}



/**
 * Returns the type of the given data.
 * 
 * @param {*} data - The data to determine the type of.
 * @returns {string} The type of the data.
 * @example
 * getType([]); // "array"
 * getType({}); // "object"
 * getType(""); // "string"
 * getType(1); // "number"
 * getType(true); // "boolean"
 * getType(null); // "null"
 * getType(undefined); // "undefined"
 * getType(() => {}); // "function"
 * getType(Symbol()); // "symbol"
 * getType(BigInt(1)); // "bigint"
 * getType(new Date()); // "date"
 */
export function getType(data) {
  return typeof data;
}


